package o;

import com.huawei.appgallery.common.media.api.OriginalMediaBean;
import com.huawei.appgallery.common.media.bean.SelectedMediaInfo;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class blm {
    public static List<OriginalMediaBean> ˎ(Map<Integer, SelectedMediaInfo> map) {
        List<OriginalMediaBean> arrayList = new ArrayList();
        Collection values = map.values();
        List<SelectedMediaInfo> asList = Arrays.asList((SelectedMediaInfo[]) values.toArray(new SelectedMediaInfo[values.size()]));
        Collections.sort(asList);
        for (SelectedMediaInfo selectedMediaInfo : asList) {
            arrayList.add(selectedMediaInfo.ॱ);
        }
        return arrayList;
    }

    public static HashMap<Integer, SelectedMediaInfo> ॱ(List<OriginalMediaBean> list) {
        HashMap<Integer, SelectedMediaInfo> hashMap = new HashMap();
        if (list == null) {
            return hashMap;
        }
        for (int i = 0; i < list.size(); i++) {
            OriginalMediaBean originalMediaBean = (OriginalMediaBean) list.get(i);
            SelectedMediaInfo selectedMediaInfo = new SelectedMediaInfo();
            selectedMediaInfo.ˏ = i + 1;
            selectedMediaInfo.ॱ = originalMediaBean;
            hashMap.put(Integer.valueOf(originalMediaBean.ᐝ()), selectedMediaInfo);
        }
        return hashMap;
    }
}
